import { http } from "@/utils/http";

type ResResult = {
  code: number;
  data: any;
};

// 查询水科耗材接口
export const queryListOutdatedFilter = (
  data:
    | {
        devType: string;
        installStart?: string;
        installEnd?: string;
        pageNum: number;
        pageSize: number;
      }
    | object
) => {
  return http.request<ResResult>("post", `/operation/api/v1/operation/consumable/listOutdatedFilter`, {
    data
  });
};

// 蓝色框其余指标的接口
export const querySpecRealTimeValue = (
  data:
    | {
        pidCode: string;
        onlyNumberPoint: boolean;
      }
    | object
) => {
  return http.request<ResResult>("post", `/operation/api/v1/pid/querySpecRealTimeValue`, {
    data
  });
};

// 耗材表格信息查询
export const queryWaterConsumableListAll = (
  data:
    | {
        devType: string;
        installStart?: string;
        installEnd?: string;
        pageNum: number;
        pageSize: number;
      }
    | object
) => {
  return http.request<ResResult>("post", `/operation/api/v1/operation/consumable/listAll`, {
    data
  });
};

// export const queryListOutdatedFilter = (params: {
//   devType: string,
//   installStart?: string,
//   installEnd?: string,
//   pageNum: number,
//   pageSize: number
// }) => {
//   return http.request<ResResult>("post", `/operation/api/v1/operation/consumable/listOutdatedFilter`, {
//     params
//   });
// };

//耗材获取id
export const checklisttemplatesearch = (data?: object) => {
  return http.request<ResResult>("post", `/pms/checklist-template/search`, {
    data
  });
};

//临时调整化滤额定寿命
export const consumableadjustFilterLifetime = (data?: object) => {
  return http.request<ResResult>("post", `/operation/api/v1/operation/consumable/adjustFilterLifetime`, {
    data
  });
};

//化滤额定寿命调整历史
export const consumablelistLifetimeAdjustHistory = (data?: object) => {
  return http.request<ResResult>("post", `/operation/api/v1/operation/consumable/listLifetimeAdjustHistory`, {
    data
  });
};
